<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>svn文件合并3 最高版本</title>
<style type="text/css">
* {
	margin: 0;
	padding: 0;
	font-size: 12px;
	line-height: 25px;
}

#loginBox {
	width: 300px;
	border: 1px solid #ccc;
	background: #FFF;
}

h1 {
	height: 35px;
	line-height: 35px;
	background: #e8e8e8;
	font-size: 14px;
	border-bottom: 1px solid #ccc;
	text-indent: 5px;
}

input.name,input.code {
	width: 150px;
	height: 25px;
	border: 1px solid #ccc;
	margin: 0 0 0 0px;
	padding: 0 0 0 20px;
}

input.verifyCode {
	height: 25px;
	width: 75px;
	border: 1px solid #ccc;
}


input.loginBtn,input.registerBtn {
	width: 54px;
	height: 21px;
	border: none;
	margin: 5px;
}

html,body {
	/*background: url("../images/background-top.png") no-repeat scroll 0 0 #318DAC;*/
	border: 0px solid #333333;
	color: #333333;
	font: 12px/150% Arial, Helvetica, sans-serif, '宋体';
	margin: 0;
	padding: 0;
	font-family: Arial, Tahoma, Verdana, sans-serif;
	font-size: 12px;
}


.header {
	height: 88px;
	margin-top: auto;
	padding: 0 10px;
	position: relative;
	background: 
		#318DAC;
}

#uploadFileDiv {
	height: 50px;
	overflow: hidden;
}

#fileQueue {
	width: 500px;
	padding: 10px;
	max-height: 220px;
	overflow: hidden;
}

.imgWrap {
	padding: 2px;
	border: 1px solid #ccc;
	float: left;
	margin-left: 10px;
	margin-top: 10px;
}

#progressBar {
	border: 1px solid #ccc;
	width: 500px;
	height: 20px;
	clear: both;
	margin-left: 10px;
	position: relative;
}

#progressInner {
	background: red;
	width: 0%;
	height: 20px;
}

#progressMsg {
	width: 100%;
	text-align: center;
	color: #000;
	font-weight: bold;
	position: absolute;
	left: 0;
	top: 0;
}

#left {
	color: red;
	padding: 0 5px;
	font-weight: bold;
	font-size: 14px;
}

.readonly {
	background: #eee;
	border: 1px solid #ccc;
	padding: 2px 5px;
}

.handler {
	width: 15px;
	height: 10px;
	border-right: solid 1px #888;
	border-bottom: solid 1px #888;
	float: right; right : 1px;
	bottom: 1px;
	cursor: nw-resize;
	right: 1px;
}
img{border:1px solid #ccc;}
textarea{overflow:auto;}
.in{width:99%;padding:2px;}
</style>
</head>
<body>
<?php
$content="";
if(!empty($_POST)){	
	$content = trim($_POST['content']);

$arr = explode("\n",$content);
$result = array();
foreach($arr as $v){
	$v = trim($v);
if(empty($v)){
 continue;
}	
$v = preg_replace('/\s+/',' ',$v);
$sub = explode(" ",$v);
	if(empty($result[$sub[0]])){
		$result[$sub[0]] = $sub[1];
	}else if($result[$sub[0]]<$sub[1]){
		$result[$sub[0]] = $sub[1];
	}
	
}
$results = "";
ksort($result);
foreach($result as $k=>$v){
$results.=$k." ".$v."\n";
}
$results = trim($results);

}
?>
	
	<div style="margin-top: 0; padding: 5px;">
		<h1>svn文件合并</h1>
		<form method='post' style='padding:5px 0 0;'>		
		<textarea id="elm1" name="content" rows="8"   style="width:99%;"><?php echo $content;?></textarea>
		<input type='submit' name='submit' class='verifyCode' value='提交' style='margin:0 5px;'/>
		
		</form>
		<?php if($result){?>		
		<textarea   rows="8"   style="width:99%;"><?php echo $results;?></textarea>
		<?php }?>
	
	</div>
	<?php include_once('merge_common.php')?>
</body>
</html>
